load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
    name = "go_default_library",
    srcs = ["subresource-access-test.go"],
    importpath = "kubevirt.io/kubevirt/cmd/subresource-access-test",
    visibility = ["//visibility:private"],
    deps = [
        "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
        "//vendor/k8s.io/client-go/rest:go_default_library",
    ],
)

go_binary(
    name = "subresource-access-test",
    embed = [":go_default_library"],
    static = "on",
    visibility = ["//visibility:public"],
)

load(
    "@io_bazel_rules_docker//container:container.bzl",
    "container_image",
)

container_image(
    name = "subresource-access-test-image",
    architecture = select({
        "@io_bazel_rules_go//go/platform:linux_ppc64le": "ppc64le",
        "//conditions:default": "amd64",
    }),
    base = "//:passwd-image",
    directory = "/",
    entrypoint = ["/subresource-access-test"],
    files = [":subresource-access-test"],
    user = "1001",
    visibility = ["//visibility:public"],
)
